"""
暴露服务
1、对话聊天服务
2、配送距离的查询
"""


def smart_chat(input_query: str):
    """对话助手"""
    from my_langchain.llm import LangchainMain
    return LangchainMain(input_query)


def delivery_check(address: str, travel_mode: int = 3):
    """配送查询 - 调用 check_delivery_range"""
    from tools.amap_tool import check_delivery_range, DistanceMode

    # 模式映射
    modes = {1: DistanceMode.STRAIGHT, 2: DistanceMode.DRIVING, 3: DistanceMode.RIDING}
    mode = modes.get(travel_mode, DistanceMode.RIDING)

    return check_delivery_range(address, mode)
